package yxy.game.sdk.yxy;

import com.alibaba.fastjson.JSONObject;

import yxy.apple.http.server.business.BusinessType;
import yxy.game.bean.LoginOtherParm;
import yxy.game.login.LoginModule;

@BusinessType(code = "LOGIN")
public class Login extends Sdk_yxy {

	@Override
	public JSONObject handle(JSONObject request) throws Exception {
		
		String username = request.getString("username");
		String password = request.getString("password");
		String channel = name();
		String subchannel = name();
		String ip = request.getString("ip");

		int clusterId = request.getInteger("clusterId");
		LoginOtherParm loginOtherParm = new LoginOtherParm();
		loginOtherParm.setClusterId(clusterId);
		return new LoginModule().login(username, password, channel, subchannel, ip, loginOtherParm);
	}

}
